<template>
  <ul class="todo-list">
    <!-- completed: 完成的类名 -->
    <li v-for="item in list" :key="item.id" :class="{completed:item.isDone}" >
      <div class="view">
        <input v-model="item.isDone" class="toggle" type="checkbox" />
        <label>{{item.name}}</label>
        <button class="destroy" @click="del(item.id)"></button>
      </div>
    </li>
  </ul>
  
</template>

<script>
export default {
    name:'TodoMain',
    props:['list'],
    data(){
return{}
    },
methods: {
    del(id){
        this.$emit('delval',id)
    }
},
}
</script>